#include "No7pch.h"
#include "Renderer.h"

nmspc::Renderer::SceneData* nmspc::Renderer::scene_data = new nmspc::Renderer::SceneData;

void nmspc::Renderer::beginScene(OrthographicCamera& camera)
{
	nmspc::Renderer::scene_data->view_projection_matrix = camera.getViewProjectionMatrix();
}

void nmspc::Renderer::endScene()
{
}

void nmspc::Renderer::submit(const std::shared_ptr<Shader>& shader, const std::shared_ptr<nmspc::VertexArray>& vertex_array)
{
	shader->bind();
	shader->uploadUniformMat4("view_projection", scene_data->view_projection_matrix);
	vertex_array->bind();
	nmspc::RenderCommand::drawIndexed(vertex_array);
}
